/** 
 * promise形式 showModal
 * @param {object} param0 参数
 * 
 */

 export const showModal=({content})=>{
    return new Promise((resolve,reject)=>{
        wx.showModal({
            title:'提示',
            content: content,
            cancelText: '取消',
            cancelColor: '#000000',
            confirmText: '确定',
            confirmColor: '#3CC51F',
            success: (result) => {
                resolve(result)
            },
            fail: (err)=>{
                reject(err)
            },
            complete: ()=>{}
        })
    })
}

export const showToast=({title})=>{
    return new Promise((resolve,reject)=>{
        wx.showToast({
            title: title,
            icon: 'none',
            duration: 1500,
            mask: false,
            success: (result)=>{
                resolve(result)
            },
            fail: (err)=>{reject(err)},
            complete: ()=>{}
        });
    })
}

/* 
*  promise形式 login
*/

export const login=()=>{
    return new Promise((resolve,reject)=>{
        wx.login({
            timeout:10000,
            success: (result)=>{
                resolve(result)
            },
            fail: (err)=>{reject(err)},
            complete: ()=>{}
        });
    })
}